﻿using System.Web.Mvc.Html;

namespace System.Web.Mvc
{
    public static class ViewExtensions
    {
        public static MvcHtmlString ExpandedValidationSummary(this HtmlHelper html, string validationMessage)
        {
            if (!html.ViewData.ModelState.IsValid)
            {
                return MvcHtmlString.Create("<div class=\"alert alert-error\" style=\"width: 240px;\"><h4>Nieudane logowanie!</h4>"+ html.ValidationSummary(validationMessage) +"</div>");
            }

            return MvcHtmlString.Create("");
        }
    }
}